import { HTTP } from "../utils/http.js";

class TicketModule extends HTTP {
	ToickAdd(img, goods_id, code) {
		return this.request({
			url: 'stock/add',
			method: 'POST',
			data: {
				img,
				goods_id,
				code
			}
		})
	}
	// 获取交易列表
	getToickList(type, page) {
		return this.request({
			url: 'user/trading',
			data: {
				type,
				page: page + 1
			}
		})
	}
	// 交易详情
	getToickDetail(id) {
		return this.request({
			url: 'user/trading/detail',
			data: {
				id
			}
		})
	}
	
	// 撤销接口
	ToickUndo(id) {
		return this.request({
			url: 'user/trading/undo',
			data: {
				id
			}
		})
	}
}

module.exports =  new TicketModule()